import { Injectable } from '@angular/core';
import { AREA } from './clue-area';
import { DEPART } from './clue-depart';
import {FILENAME} from './clue-filename'
import {SOURCE} from './clue-source'
import {STATUS} from './clue-status'
import { HandleType } from './handle-type.service';
import { OrgService } from '../person-select-service/api/org.service';
@Injectable({
  providedIn: 'root'
})
export class ClueDataService {
  public area ;
  public depart:any[]=[];
  public filename;
  public source;
  public status;
  public myAarr:any[]=[];
  public handleType;
  public session = window.sessionStorage;
  
  constructor(public orgService:OrgService) { 
      this.area = AREA;
      this.filename = FILENAME;
      this.source = SOURCE;
      this.status = STATUS;
      this.handleType = HandleType;
  }

  setArea(item){
      this.area.push(item)
  }

  getDepart(){
    let list =  JSON.parse(this.session.getItem('areaData'));
    for(let i = 0;i<list.length;i++){
      if(list[i].officeType == "1"){
        this.depart.push({regdepname:list[i].officeName,regdepvalue:list[i].officeId})
      }
    }
  }

  // myAddClue(succ){
  //   this.myAarr.splice(0,1,succ.data);
  //   return this.myAarr
  // }

}
